# Maintainer: Biswapriyo Nath <nathbappai@gmail.com>

_realname=qalculate-qt
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=5.5.1
pkgrel=1
pkgdesc="Qt frontend for libqalculate (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64')
url='https://qalculate.github.io/'
msys2_repository_url='https://github.com/Qalculate/qalculate-qt'
license=('spdx:GPL-2.0-or-later')
depends=(
  "${MINGW_PACKAGE_PREFIX}-libqalculate"
  "${MINGW_PACKAGE_PREFIX}-qt6-base"
  "${MINGW_PACKAGE_PREFIX}-qt6-svg"
)
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-cc"
  "${MINGW_PACKAGE_PREFIX}-pkgconf"
  "${MINGW_PACKAGE_PREFIX}-qt6-tools"
)
source=("https://github.com/Qalculate/qalculate-qt/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('2d01841f7a7703417c6c251bcd6bcda81db0bf7d5c32827b7a8b396d572af843')

build() {
  cd "${_realname}-${pkgver}"
  "${MINGW_PREFIX}/bin/qmake6.exe" PREFIX="${MINGW_PREFIX}"
  make
}

package() {
  cd "${_realname}-${pkgver}"
  install -Dm755 release/qalculate-qt.exe "${pkgdir}${MINGW_PREFIX}"/bin/qalculate-qt.exe
  install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
